package com.media.themovieworld.widget.popupwindow;

import android.content.Context;
import android.graphics.Rect;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;

import com.media.themovieworld.R;
import com.media.themovieworld.activity.MainActivity;

public class MovieSearchPopup extends MoviePopupWindow{

	private EditText mEditText;
	private ListView mListView;
	
	public MovieSearchPopup(Context context) {
		super(context);
	}

	@Override
	protected View getPopupContentView() {
		View v = LayoutInflater.from(mContext).inflate(R.layout.tmw__layout_search, null);
		mEditText = (EditText) v.findViewById(R.id.tmw__layout_search_edittext);
		mListView = (ListView) v.findViewById(R.id.tmw__layout_search_listview);
		return v;
	}

	@Override
	protected int getPopupWidth() {
		return MainActivity.SCREEN_WIDTH;
	}
	
	private void listenerTextChange(){
	}
	
	public void show(View anchor) {
		preShow();
		int[] location 		= new int[2];
		anchor.getLocationOnScreen(location);
		Rect anchorRect 	= new Rect(location[0], location[1], location[0] + anchor.getWidth(), location[1] 
		                	+ anchor.getHeight());
		int xLocation = anchorRect.left;
		int yLocation = anchorRect.bottom;
		mWindow.showAtLocation(anchor, Gravity.NO_GRAVITY, xLocation, yLocation);
	}

}
